class Solution(object):
    def xorQueries(self, arr, queries):
        for i in range(1, len(arr)):
            arr[i] ^= arr[i - 1]
        m = len(queries)
        out = [0] * m
        for index, (u, v) in enumerate(queries):
            if u == 0:
                out[index] = arr[v]
            else:
                out[index] = arr[v] ^ arr[u - 1]
        return out